/* 
 * File:   TileMap.h
 * Author: agu
 *
 * Created on 14 de junio de 2014, 1:23
 */

#ifndef TILEMAP_H
#define	TILEMAP_H
#include <vector>
#include <string>
#include "client_Texture.h"
#include "client_Animation.h"
using std::vector;
using std::string;
class TileMap {
public:
    TileMap();
    TileMap(SDL_Renderer* renderer);
    void setRenderer(SDL_Renderer* renderer);
    void load(const string tileMap);
    void update(const string tileMap);
    void render();
    bool havePlayer();
    bool haveExplotion();
    void getPlayerPosition(int& x,int&y);
    string getPlayerPath();
    void setPlayerCode(const string codePlayer);
    virtual ~TileMap();
private:
    void free();
    void loadByCode(char codTileMap,unsigned int i,unsigned int j);
    void identifPlayer(string codTileMap,unsigned int i,unsigned int j);
    unsigned int numColumns;
    unsigned int numRows;
    SDL_Renderer* renderer;    
    vector<Texture*> staticItems;
    vector<Animation*> dinamicItems;
    int posX,posY;
    string pathPlayer;    
    bool explotion;
    string playerCode;
};

#endif	/* TILEMAP_H */

